import { actionTypes} from "./actionTypes";
import {getOrders} from "../api/order";

export const getNotifications = (dispatch) => {
    return (async(dispatch) => {
        let orders = [];
        await getOrders().then(res => {
            orders = res.data ? res.data: [];
        }).catch(err => {
            console.log(err)
        })
        dispatch({
            type: actionTypes.GetNotification,
            orders
        })
    })(dispatch)
}
